package com.eva.job.constants;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 任务常量
 */
public interface JobConstants {

    // jobId在JOB实例中的存储参数键
    String DATA_MAP_JOB_ID = "JOB_ID";

    /**
     * JOB状态
     */
    @Getter
    @AllArgsConstructor
    enum JobStatus {
        READY((byte) 0, "已准备"),
        RUNNING((byte) 1, "运行中"),
        ;

        private final byte code;

        private final String remark;
    }

    /**
     * 分片状态
     */
    @Getter
    @AllArgsConstructor
    enum LogStatus {
        FAILED((byte) 0, "执行失败"),
        SUCCESS((byte) 1, "执行成功"),
        IGNORE((byte) 2, "跳过"),
        NONE((byte) -1, "执行中"),
        ;

        private final byte code;

        private final String remark;
    }

    /**
     * 触发类型
     */
    @Getter
    @AllArgsConstructor
    enum TriggerType {
        SYSTEM("SYSTEM", "系统"),
        MANUAL("MANUAL", "手动"),
        ;

        private final String code;

        private final String remark;
    }
}
